package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {

	// 查询关联
	@GET
	@Path("/association")
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociation();

	// 查询未关联
	@GET
	@Path("/association/{customerFixedAreaId}")
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findAssociation(@PathParam("customerFixedAreaId") String customerFixedAreaId);

	// 关联操作
	@PUT
	@Path("/updateAssociation")
	public void updateAssociation(@QueryParam("customerFixedAreaId") String customerFixedAreaId,
			@QueryParam("customerIdStr") String customerIdStr);

	// 添加用户
	@POST
	@Path("/addCustomer")
	@Consumes({ "application/xml", "application/json" })
	public void addCustomer(Customer customer);

	// 根据电话查询
	@GET
	@Path("/findByTelephone")
	@Produces({ "application/xml", "application/json" })
	public Customer findByTelephone(@QueryParam("telephone") String telephone);

	// 修改邮箱激活状态
	@PUT
	@Path("/updateType")
	@Consumes({ "application/xml", "application/json" })
	public void updateType(@QueryParam("telephone") String telephone);

	// 登录校验
	@GET
	@Path("/loginCheck")
	@Produces({ "application/xml", "application/json" })
	public Customer login(@QueryParam("telephone") String telephone, @QueryParam("password") String password);

	// 根据地址查询区域id
	@GET
	@Path("/findFixedAreaId")
	@Consumes({ "application/xml", "application/json" })
	public String findFixedAreaId(@QueryParam("address") String address);
}
